export class Module {
    id: number;
    code: string;
    parentGuid: string;
    name: string;
    level: number;
    url: string;
    iconUrl: string;
    description: string;
    sequence: number;

    // Custom properties
    isActiveRouteLink: boolean;
    isExpandedRouteLink: boolean;
    localizedName: string;
    children: Module[];

    static createModule(name: string, url: string): Module {
        let m = new Module();
        m.url = url;
        m.name = name;
        m.children = [];
        return m;
    }
}

export class Role {
    id: number;
    idAlias: string;
    name: string;
    description: string;
}

export class RBACModel {
    userGuid: string;
    isAdmin: boolean;
    modules: Module[];
    roles: Role[];
}

export class User {
    userGuid: string;
    userName: string;
    phone: string;
    email: string;
    contactEmail: string;
    enName: string;
    cnName: string;
    gender: number;
    avatar: string;
    status: number;
}
